package com.my.study.mybatis.reflection;

import org.apache.ibatis.reflection.TypeParameterResolver;

import java.lang.reflect.Type;

/**
 * @author: yidujun
 * @create: 2021/07/01 10:03
 */
public class TypeParameterResolverTest {

    public static void main(String[] args) throws Exception {

        Type type = TypeParameterResolver.resolveReturnType(User.class.getMethod("operator"), User.class);
        System.out.println(type);

        Type userName = TypeParameterResolver.resolveFieldType(User.class.getDeclaredField("name"), User.class);
        System.out.println(userName);

        Type studentName = TypeParameterResolver.resolveFieldType(Student.class.getDeclaredField("studentName"), Student.class);
        System.out.println(studentName);

    }

}
